Minor internal restructuring in KML writer - no "real" change.
authorrobertl <robertl>
Tue, 11 Sep 2007 10:46:28 +0000 (10:46 +0000)
committerrobertl <robertl>
Tue, 11 Sep 2007 10:46:28 +0000 (10:46 +0000)
kml.c

diff --git a/kml.c b/kml.c
index 62e33962464dbb1b63dbc24f42898fcf91e0fab4..9060ee9e9b43700e0666c4bb00cb36094c90934d 100644 (file)
--- a/kml.c
+++ b/kml.c
@@ -881,22 +881,30 @@ void kml_write(void)
        }
 
        // Output trackpoints
-       if (!realtime_positioning && track_waypt_count()) {
-               kml_write_xml(1,  "<Folder>\n");
-               kml_write_xml(0,  "<name>Tracks</name>\n");
-       }
-       track_disp_all(kml_track_hdr, kml_track_tlr, kml_track_disp);
-       if (!realtime_positioning && track_waypt_count()) {
-               kml_write_xml(-1,  "</Folder>\n");
+       if (track_waypt_count()) {
+               if (!realtime_positioning) {
+                       kml_write_xml(1,  "<Folder>\n");
+                       kml_write_xml(0,  "<name>Tracks</name>\n");
+               }
+
+               track_disp_all(kml_track_hdr, kml_track_tlr, kml_track_disp);
+
+               if (!realtime_positioning) {
+                       kml_write_xml(-1,  "</Folder>\n");
+               }
        }
 
        // Output routes
-       if (!realtime_positioning && route_waypt_count()) {
-               kml_write_xml(1,  "<Folder>\n");
-               kml_write_xml(0,  "<name>Routes</name>\n");
-               route_disp_all(kml_route_hdr, kml_route_tlr, kml_route_disp);
-               kml_write_xml(-1,  "</Folder>\n");
-       }
+       if (route_waypt_count()) {
+               if (!realtime_positioning) {
+                       kml_write_xml(1,  "<Folder>\n");
+                       kml_write_xml(0,  "<name>Routes</name>\n");
+
+                       route_disp_all(kml_route_hdr, 
+                               kml_route_tlr, kml_route_disp);
+                       kml_write_xml(-1,  "</Folder>\n");
+               }
+        }
 
        kml_write_xml(-1, "</Document>\n");
        kml_write_xml(-1, "</kml>\n");